#!/usr/bin/python
"""This is the settings file for pydownloads."""

## Should we display errors and warnings?
DEBUG = True
TEMPLATE_DEBUG = DEBUG

# Verbosity of the warnings
# 1 - 4, where 1 reports only important warnings and 4 reports all warnings
# Can also be a list of verbosity levels, eg: [1,3] or [4]
VERBOSITY = 4

## Where is django?
DJANGO_PATH = "/path/to/django"

## Content location ##
LOCATION = "../example_content/"

## Content location, relative to www
HTTPPATH = "/pydownloads/example_content/"

## Templates locations
TEMPLATE_DIRS = ('../example_content/Data/templates',)

## Database to use
DATABASE_FILE = "flatfile"

## Default category view
VIEW = "grid"

## Home page grid dimensions
# (rows,columns)
HP_DIMENSIONS = (2, 3)

## Program to use to get mimetype
MIME_PROGRAM = "file -b --mime-type %s"

## Rewrite urls to make them look nicer?
URL_REWRITE = True

## Force pydownloads to be in embed mode? (<head> and <body> tags are left out)
EMBEDDED = False

## Do not edit anything beyond this point ##
import os

# Convert LOCATION to absolute
LOCATION = os.path.abspath(LOCATION)

# Add / to location if needed
if LOCATION[-1] != "/":
    LOCATION = LOCATION + "/"
if HTTPPATH[-1] != "/":
    HTTPPATH = HTTPPATH + "/"

# Convert TEMPLATE_DIRS to absolute
TEMPLATE_DIRS = tuple(os.path.abspath(i) for i in TEMPLATE_DIRS)